import Router from "koa-router";
import {
  getHeroById,
  getHeroList,
  createdHero,
  updateHero,
  deleteHero,
} from "../controller/hero.controller.js";
import { addSkins, getSkinList } from "../controller/skinList.controller.js";
import {
  heroVerification,
  heroSkillListVerification,
} from "../middleware/hero.middleware.js";
const router = new Router({
  prefix: "/hero",
});
// 获取英雄所有信息
router.get("/list", getHeroList);
// 根据id 查询英雄信息
router.get("/getHeroInfoById", getHeroById);
// 新增英雄信息
router.post("/addHeroInfo", heroVerification, createdHero);
// 修改英雄信息
router.put("/updateHeroInfo/:id", heroVerification, updateHero);
// 删除英雄信息
router.delete("/deleteHeroInfo/:id", deleteHero);
// 新增皮肤
router.post("/addSkins", heroSkillListVerification, addSkins);

// 查询皮肤
router.get("/getSkins", getSkinList);
export default router;
